import org.junit.Test;

import static org.junit.Assert.*;

public class GraphTest_BlackBox {
    Matrix mt0=new Matrix();
    ExerciseHash Ehash0=new ExerciseHash();
    String finalstr0= "My thanks are due in three quarters.\n" +
            "To the Public, for the indulgent ear it has inclined to a plain tale with few pretensions.\n" +
            "To the Press, for the fair field its honest suffrage has opened to an obscure aspirant.\n" +
            "To my Publishers, for the aid their tact, their energy, their practical sense and frank liberality have afforded an unknown and unrecommended Author.";
    String splitstr0[]=finalstr0.split(" ");

    @Test
    public void queryBridgeWords1test1() throws Exception {
        String bridge1st="to";
        String bridge2nd="plain";

        Ehash0.calcletter(finalstr0);
        mt0.Creatematrix(Ehash0, finalstr0);
        Graph G0=new Graph(mt0.size, splitstr0.length, mt0);
        String finalbridge=G0.queryBridgeWords1(bridge1st, bridge2nd);

        assertEquals("a",finalbridge);
    }

    @Test
    public void queryBridgeWords1test2() throws Exception {
        String bridge1st="to";
        String bridge2nd="123";

        Ehash0.calcletter(finalstr0);
        mt0.Creatematrix(Ehash0, finalstr0);
        Graph G0=new Graph(mt0.size, splitstr0.length, mt0);
        String finalbridge=G0.queryBridgeWords1(bridge1st, bridge2nd);

        assertEquals(null,finalbridge);
    }

    @Test
    public void queryBridgeWords1test3() throws Exception {
        String bridge1st="to";
        String bridge2nd="业知翰";

        Ehash0.calcletter(finalstr0);
        mt0.Creatematrix(Ehash0, finalstr0);
        Graph G0=new Graph(mt0.size, splitstr0.length, mt0);
        String finalbridge=G0.queryBridgeWords1(bridge1st, bridge2nd);

        assertEquals(null,finalbridge);
    }

    @Test
    public void queryBridgeWords1test4() throws Exception {
        String bridge1st="to";
        String bridge2nd=" ";

        Ehash0.calcletter(finalstr0);
        mt0.Creatematrix(Ehash0, finalstr0);
        Graph G0=new Graph(mt0.size, splitstr0.length, mt0);
        String finalbridge=G0.queryBridgeWords1(bridge1st, bridge2nd);

        assertEquals(null,finalbridge);
    }

    @Test
    public void queryBridgeWords1test5() throws Exception {
        String bridge1st="to";
        String bridge2nd="!";

        Ehash0.calcletter(finalstr0);
        mt0.Creatematrix(Ehash0, finalstr0);
        Graph G0=new Graph(mt0.size, splitstr0.length, mt0);
        String finalbridge=G0.queryBridgeWords1(bridge1st, bridge2nd);

        assertEquals(null,finalbridge);
    }
}